﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmListVentas.aspx.cs" Inherits="WEB.frmListVentas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
	<div class="panel panel-default">
		<div class="panel-heading">
			<div class="row">
				<div class="col-sm-9">
					<h3>Listado de Ventas</h3>
				</div>
				<div class="col-sm-3">
					<a href="frmVentas.aspx?opc=nuevo" class="btn btn-success" style="text-decoration:none; margin: auto; color: #ffffff;">Nueva Venta</a>
				</div>
			</div>
		</div>
		<div class="panel-body">
			<table>
				<tr>
					<td>
						<label>Criterio:  </label>
					</td>
					<td>
						<asp:TextBox ID="txtCriterio" placeholder="Buscar" runat="server" />
					</td>
					<td>
						<asp:Button ID="btnBuscar" Text="Buscar" CssClass="btn btn-primary" runat="server" />
					</td>
				</tr>
			</table>
		</div>
		<%--Tabla para cargar datos--%>
		<asp:ListView ID="lvVentas" SelectMethod="GetVentas" 
            ItemType="Box.Entities.Venta" runat="server">
			<EditItemTemplate>
				<b>No Existen Ventas..!!</b>
			</EditItemTemplate>
			<LayoutTemplate>
				<table class="table table-bordered table-striped table-hover table-condensed">
					<thead>
						<tr>
							<th>#</th>
							<th>Ruc/Dni</th>
							<th>Razon Social</th>
							<th>Fecha</th>
							<th>Total</th>
							<th>Acciones</th>
						</tr>
					</thead>
					<tbody>
						<tr id="itemPlaceholder" runat="server"/>
					</tbody>
				</table>
			</LayoutTemplate>
			<ItemTemplate>
				<tr>
					<td><%# Item.Id %></td>
					<td><%# Item.Cliente.RucCliente %></td>
					<td><%# Item.Cliente.NombreCliente %></td>
					<td><%# Item.Fecha.ToShortDateString() %></td>
					<td><%# Item.Total %></td>
					<td>
						<a href='frmVentas.aspx?opc=editar%id=<%# Item.Id %>'>Editar</a>
						<a href='frmListVentas?opc=delete%id=<%# Item.Id %>'
							onclick='return confirm("Desea eliminar la venta?");'>Eliminar</a>
					</td>
				</tr>
			</ItemTemplate>
		</asp:ListView>

		
	</div>
</asp:Content>
